<template>
  <div>
    <button @click="back">后退</button>&nbsp;
    <button @click="forward">前进</button>
    <br><br>
    <button @click="test">测试一下go</button>
    <h2>我的姓名：{{ name }}</h2>
    <p @click="age++">年龄：{{age}}，这个不讲{{sex}} </p>
    <h3>上面这部分是常规的</h3>
    <ul v-for="m in mes" :key="m.id">
      <li>{{ m.id }}{{ m.title }}</li>
    </ul>
  </div>
</template>

<script>
export default {
    name:'MyName',
    data(){
        return {
            name:'luoyu',
            age:19,
            sex:'gender',
            mes:[{id:'001',title:'djdj'},{id:'002',title:'djdjk'}]
        }
    },
    methods:{
      back(){
        this.$router.back()
      },
    forward(){
      this.$router.forward()
    },
    test(){
      this.$router.go(-1)
    }
    }
}
</script>
